import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/order_count_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class OrderCountEntity {
	late int code;
	late OrderCountObj obj;
	late String msg;

	OrderCountEntity();

	factory OrderCountEntity.fromJson(Map<String, dynamic> json) => $OrderCountEntityFromJson(json);

	Map<String, dynamic> toJson() => $OrderCountEntityToJson(this);

	OrderCountEntity copyWith({int? code, OrderCountObj? obj, String? msg}) {
		return OrderCountEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class OrderCountObj {
	late int pending;
	late int processing;
	late int hanging;
	late int processed;

	OrderCountObj();

	factory OrderCountObj.fromJson(Map<String, dynamic> json) => $OrderCountObjFromJson(json);

	Map<String, dynamic> toJson() => $OrderCountObjToJson(this);

	OrderCountObj copyWith({int? pending, int? processing, int? hanging, int? processed}) {
		return OrderCountObj()
			..pending= pending ?? this.pending
			..processing= processing ?? this.processing
			..hanging= hanging ?? this.hanging
			..processed= processed ?? this.processed;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}